<template>
  <div>
    <!-- 标题 -->
    <el-row type="flex" justify="start">
      <el-col>
        <h3>
          <span class="shape"></span>
          批量公告
        </h3>
      </el-col>
    </el-row>

    <!-- 主体 -->
    <el-card class="box-card" style="background: #fafbfd">
      <el-form :model="form" label-position="right" label-width="150px">
        <el-form-item label="公告时间:">
          <el-input
            v-model="form.announcementTime"
            autocomplete="off"
            style="width: 25%"
          ></el-input>
        </el-form-item>
        <el-form-item label="公告载体:">
          <el-select
            v-model="form.region"
            style="width: 25%"
            placeholder="请选择活动区域"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="到期提醒执法人员:">
          <el-input
            v-model="form.linkman"
            autocomplete="off"
            style="width: 25%"
          ></el-input>
        </el-form-item>
        <el-form-item label="到期时间:">
          <el-input
            v-model="form.information"
            autocomplete="off"
            style="width: 25%"
          ></el-input>
        </el-form-item>
        <el-form-item label="到期提醒联系人:">
          <el-input
            v-model="form.information"
            autocomplete="off"
            style="width: 25%"
          ></el-input>
        </el-form-item>
        <el-form-item label="到期提醒联系方式:">
          <el-input
            v-model="form.information"
            autocomplete="off"
            style="width: 25%"
          />
        </el-form-item>
        <el-form-item label="公告照片:">
          <el-image
            style="width: 150px; height: 90px"
            :src="url"
            :preview-src-list="srcList"
          />
        </el-form-item>
        <el-form-item label="是否领取:">
          <el-radio v-model="radio" label="1">是</el-radio>
          <el-radio v-model="radio" label="2">否</el-radio>
        </el-form-item>
        <el-form-item label="领取人姓名:">
          <el-input
            v-model="form.information"
            autocomplete="off"
            style="width: 25%"
          />
        </el-form-item>
        <el-form-item label="领取人联系方式:">
          <el-input
            v-model="form.information"
            autocomplete="off"
            style="width: 25%"
          />
        </el-form-item>
        <el-form-item label="领取照片:">
          <el-upload
            action="https://jsonplaceholder.typicode.com/posts/"
            list-type="picture-card"
            :on-preview="handlePictureCardPreview"
            :on-remove="handleRemove"
          >
            <i class="el-icon-plus"></i>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="" />
          </el-dialog>
        </el-form-item>
        <el-form-item>
          <el-button>取消</el-button>
          <el-button style="background: #2f6fdb" type="primary">编辑</el-button>
          <el-button style="background: #2bb291; color:white">保存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  props: {
    flag: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      form: {},
      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      srcList: [
        "https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
        "https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
      ],
    };
  },
  methods: {
    cancel() {
      this.$emit("update:flag", true);
    },
  },
};
</script>

<style lang="scss" scoped>
.shape {
  display: inline-block;
  width: 5px;
  height: 14px;
  margin-top: -3px;
  margin-right: 5px;
  vertical-align: middle;
  background: #517dc8;
}
</style>
